<?php

namespace app\common\services;


//只用于加载项目公用文件
use yii\helpers\Html;

class StaticServices {
  public static $api_conf = [
      'APP_ID'     => '10584752',
      'API_KEY'    => 'SGMfa9o4bG8mvUBrmEFQxNPS',
      'SECRET_KEY' => 'GUVPlZmeSpt2keERhZzjvRG20HTTVo0Q',
  ];

  public static function includeAppJs($path, $depend)
  {
    return self::includeApp('js', $path, $depend);
  }

  public static function includeAppCss($path, $depend)
  {
    return self::includeApp('css', $path, $depend);
  }

  private static function includeApp($type, $path, $depend)
  {
    $version = defined('VERSION') ? VERSION : time();
    if ($type == 'js') {
      $path = $path . '?ver=' . $version;
      \Yii::$app->getView()->registerJsFile($path, ['depends' => $depend]);
    }
    if ($type == 'css') {
      \Yii::$app->getView()->registerCssFile($path, ['depends' => $depend]);
    }
  }

  public static function encode($display)
  {
    return Html::encode($display);
  }

  public static function timeArr()
  {
    return [ '11' => 110, '12' => 278, '13' => 278, '14' => 110, '15' => 110, '16' => 110, '17' => 110, '18' => 278, '19' => 278, '20' => 204, '21' => 110];
//    return ['11' => 10, '12' => 10, '13' => 10, '14' => 10, '15' => 10, '16' => 10, '17' => 10, '18' => 10, '19' => 10, '20' => 10, '21' => 10];
  }

  public static function getHongbao()
  {
    return ['1' => 1, '2' => 1.2, '3' => 1.5, '4' => 1.6, '5' => 1.8, '6' => 12.2];
  }
}
